-- card: 3019 from stack: in.6 -- bmap block id: 5095 -- flags: 0000 -- background id: 3411 -- name: What is ShowDialog ----- HyperTalk script ----- on turnOn buttonNo lock screen repeat with counter = 1 to 4 if buttonNo = counter then set the hilite of cd btn counter to TRUE show bg fld counter else set the hilite of cd btn counter to FALSE hide bg fld counter end if end repeat set scroll of bg fld buttonNo to 0 show bg btn "Close Information" unlock screen with visual effect dissolve end turnOn on closeall set cursor to watch lock screen repeat with x = 1 to 4 hide bg fld x set hilite of cd btn x to FALSE end repeat hide bg btn "Close Information" unlock screen with visual effect dissolve end closeall on closecard closeall end closecard on printIt put bg fld 1 & return & bg fld 2 & return & bg fld 3 & return & bg fld 4 into container put bg fld "Title" into prompt PrintDoc prompt,container,prompt,times,12 end printIt -- part 1 (button) -- low flags: 00 -- high flags: A004 -- rect: left=17 top=90 right=112 bottom=194 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: What is ShowDialog? ----- HyperTalk script ----- on mouseUp if the visible of bg fld (the number of me) then closeall else put the number of me into displayinfo turnOn displayinfo end if end mouseUp -- part 2 (button) -- low flags: 00 -- high flags: A004 -- rect: left=17 top=120 right=142 bottom=194 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Forms of ShowDialog ----- HyperTalk script ----- on mouseUp if the visible of bg fld (the number of me) then closeall else put the number of me into displayinfo turnOn displayinfo end if end mouseUp -- part 3 (button) -- low flags: 00 -- high flags: A004 -- rect: left=17 top=150 right=172 bottom=194 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Show Dialog XCMD uses... ----- HyperTalk script ----- on mouseUp if the visible of bg fld (the number of me) then closeall else put the number of me into displayinfo turnOn displayinfo end if end mouseUp -- part 4 (button) -- low flags: 00 -- high flags: A004 -- rect: left=17 top=180 right=202 bottom=194 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: How to use it? ----- HyperTalk script ----- on mouseUp if the visible of bg fld (the number of me) then closeall else put the number of me into displayinfo turnOn displayinfo end if end mouseUp -- part 7 (button) -- low flags: 00 -- high flags: 0000 -- rect: left=11 top=4 right=64 bottom=78 -- title width / last selected line: 0 -- icon id / first selected line: 529 / 529 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: SD -- part contents for background part 21 ----- text ----- What is ShowDialog XCMD? -- part contents for background part 17 ----- text ----- ShowDialog XCMD takes seven forms: Type 1, Type 2, Type 3, Type 4, Type 5, Type 6, and Type 7. Type 1 allows for "regular" buttons, icons, PICTs, and static text only. You can modify the text as you wish in the parameter list. Type 2 can have these and ALSO any number of editable text fields that the user can type into and an unlimited number of check boxes. One of these fields can also contain default text (provided in the parameters). Type 3 shares the same attributes as Type 2 with the exception that you can have as many radio buttons as you want instead of the check boxes. Type 4 is also similar to Type 2 with the exception that this type contains a popup menu. Types 5 and 6 are used to display "help" screens consisting of multiple PICTs. Type 7 displays a scrolling field from which the user can select lines in a fashion similar to the Font/DA Mover. You specify the font, pt. size, and default line of the list in the parameter list. This type can also respond to any number of "regular" buttons. -- part contents for background part 15 ----- text ----- One of problems with creating professional stacks in HyperCard is that HyperCard's implementation of dialog boxes (the "ask" and "answer" boxes) are too restrictive (too small) as well as being less than glamorous (no icon). One way around this is to fudge a dialog box with HyperTalk, but this is a kluge, at best (you can't have a default button). ShowDialog XCMD is an external command that will allow you to display ANY type of dialog or alert that can contain ANY number of buttons, ANY amount of text, and ANY number of icons or PICT resources. You decide whether the dialog or alert is to have a default (outlined) button. You can have as many fields of static text as you wish and can modify any two of these on the fly (in the XCMD parameter list). You can have any number of editable text fields that the user can type into. One of these fields can contain a default text string (that you specify in the parameter list). Your dialog can have as many check boxes or radio buttons as you want or can have a popup menu or a scrolling list from which the user can select items. You can also create specialized dialogs for the display of interactive help screens, color icon bars, or Macintosh "splash screens." You use ResEdit to create the necessary DLOG/DITL resources that allow ShowDialog to function. -- part contents for background part 31 ----- text ----- ShowDialog XCMD uses DLOG/DITL resource "templates" for the display of dialogs and alerts. You create these resources using ResEdit, thus allowing you to create dialogs that are EXACTLY tailored to YOUR needs. If you wish, you can put the XCMD and associated DLOG/DITL templates in your Home stack, and have your customized dialogs and alerts accessible from all your stacks. The DLOG/DITL template can contain: • icons Use the icons that are imbedded in HyperCard or create and import your own with ResEdit. • PICTs These comprise the graphic artwork that you have in your dialog. They can be created in any paint or draw program and imported into a stack with ResEdit. Or you can create PICTs from within this stack using PICT Maker. Dialogs can display color PICTs. These must be created with a color paint or draw application. • text Dialogs can contain static text (that cannot be modified by the user) and editable text fields. • buttons Depending on the "type" of ShowDialog, your dialog can contain: "regular" buttons radio buttons check boxes "hot spot" buttons • Popup Menu Type 4 of ShowDialog can contain a popup menu. You can specify the style attributes of each individual menu item and disable them if you wish. The elements of the popup menu are created from "user item" type DITL items. -- part contents for background part 30 ----- text ----- 12 -- part contents for background part 18 ----- text ----- In its most basic form, use ShowDialog to replace HyperCard's standard "ask" and "answer" boxes with dialogs that adhere to the Macintosh standard. These dialogs can contain icons, PICTs, and multiple fields of text. In its more elaborate forms, ShowDialog allows you to extend the vocabulary of HyperTalk by providing a method for the display of some exceedingly complex dialogs. These dialogs can contain other forms of control structures (radio buttons, check boxes, and popup menus), and offer very sophisticated handling of graphics. ShowDialog dialogs support color icons (cicn's) and PICTs.